package com.monkey.thread;

import java.util.concurrent.TimeUnit;

/**
 * @Author MonkeyBrother
 * @Date 2020/12/14 22:03
 * @Desc
 **/
public class ShareTest {
    public static void main(String[] args) throws InterruptedException {
       while(true) {
           Share share = new Share();
           Thread t1 = new Thread(new ShareThread01(share));
           Thread t2 = new Thread(new ShareThread02(share));
           t1.start();
           t2.start();
           TimeUnit.SECONDS.sleep(2);
           System.out.println(share.getCount());
       }
    }
}
